home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / Centri / Centri.dir / 00293_Script_293 < prev    next >
Text File  |  1999-02-25  |  1KB  |  33 lines

  1. on spriteToFront sNum
  2.   set sList to []
  3.   repeat with i = sNum to 48
  4.     if the castNum of sprite i > 0 then append sList,i
  5.   end repeat
  6.   set frontSprite to getLast(sList)
  7.   set frontProps to birth(script "spriteProps",getAt(sList,1))
  8.   repeat with i = 1 to count(sList) - 1
  9.     set targetSprite to getAt(sList,i)
  10.     set sourceSprite to getAt(sList,i+1)
  11.     set theProps to birth(script "spriteProps",sourceSprite)
  12.     puppetSprite targetSprite,true
  13.     setProps(theProps,targetSprite)
  14.   end repeat
  15.   puppetSprite frontSprite,true
  16.   setProps(frontProps,frontSprite)
  17.   updateStage
  18.   return frontSprite
  19. end
  20.  
  21. on castToFront cNum  -- cNum can also be the name of the cast
  22.   set cNum to the number of cast cNum
  23.   set frontSprite to 0
  24.   if cNum > 0 then
  25.     set scList to []
  26.     repeat with i = 1 to 48
  27.       append scList,the castNum of sprite i
  28.     end repeat
  29.     set sNum to getOne(scList,cNum)
  30.     if sNum > 0 then set frontSprite to spriteToFront(sNum)
  31.   end if
  32.   return frontSprite
  33. end